<?php

namespace Wgx\Admin\Test;

use PhpYes\Com\Render;

class App extends \Wgx\Admin\Com\App
{
    public function base_dir()
    {
        return BASE_DIR;
    }

    public function home_dir()
    {
        return BASE_DIR;
    }

    public function config_dir()
    {
        return BASE_DIR . '/config';
    }

    public function config_route_file()
    {
        return 'route.php';
    }

    public function render()
    {
        if (\PhpYes\Apps::$kv[self::KEY_RENDER]) {
            \PhpYes\Apps::$kv[self::KEY_RENDER] = new  Render(true, $this->getPageMap());
        }
        return \PhpYes\Apps::$kv[self::KEY_RENDER];
    }

    public function adminToMenuDb()
    {
        return \PhpYes\Apps::getSingle(DbConn::class);
    }

    public function userDb()
    {
        return \PhpYes\Apps::getSingle(DbConn::class);
    }
}